﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Microsoft.FamilyShow"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="Microsoft.FamilyShow.PhotoViewer"
    xmlns:properties="clr-namespace:Microsoft.FamilyShow.Properties"
    IsVisibleChanged="UserControl_IsVisibleChanged">
    <UserControl.Resources>
        <local:ImageConverter x:Key="ImageConverter"/>
        <Image x:Key="searchpng" Source="..\Images\Search.png" Height="16" Width="16" />
    </UserControl.Resources>

    <Border Margin="10,0,10,10" Style="{DynamicResource BorderStyle}" Background="{DynamicResource BackgroundBrush}" Width="Auto" Height="Auto">

        <DockPanel>

            <!-- Header Panel-->
            <DockPanel Margin="0,0,10,0" DockPanel.Dock="Top" Height="30">
                <Image Margin="10,0,0,0" VerticalAlignment="Center" Source="..\Images\Photo.png" Width="16" Height="16" />
                <TextBlock Text="{x:Static properties:Resources.PhotosMenu}" Style="{DynamicResource HeaderStyle}" FontWeight="Bold" Margin="5,0,0,0" VerticalAlignment="Center" Foreground="{DynamicResource HeaderFontColor}"/>
                <Button Width="Auto" MinWidth="40" Content="{x:Static properties:Resources.Back}" Click="CloseButton_Click" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" DockPanel.Dock="Right" Height="15" x:Name="CloseButton" IsCancel="True" IsDefault="True" FontSize="10"/>
            </DockPanel>

            <Border CornerRadius="0,0,10,10" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0" Background="{DynamicResource PersonInfoBackgroundBrush}">
                <Grid DockPanel.Dock="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <!-- Photos Viewer-->
                    <Border Margin="10,10,10,5">

                        <StackPanel>
                            <Image x:Name="DisplayPhoto"  Margin="10,10,10,10" Stretch="Uniform" MaxHeight="280" Height="280"/>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <TextBlock HorizontalAlignment="Center" Height="15" MaxWidth="415" MaxHeight="20" x:Name="CaptionTextBlock" Margin="10,0,10,0" Foreground="{DynamicResource FontColor}" FontSize="11" FontStyle="Italic" TextTrimming="CharacterEllipsis"/>
                                <Button Height="15" Width="Auto" MinWidth="60" x:Name="View" Content="{x:Static properties:Resources.View}" Click="OpenPhotoButton_Click" Style="{DynamicResource RedButtonStyle}"/>
              </StackPanel>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" x:Name="TagsStackPanel">
                                <Label Content="{x:Static properties:Resources.TagsColon}" FontSize="11" VerticalAlignment="Stretch" Foreground="{DynamicResource FontColor}"  Margin="5,0,0,0"/>
                                <ListBox MaxWidth="300" MaxHeight ="25" Height="25" x:Name="TagsListBox" Background="{x:Null}" BorderBrush="{x:Null}"  Style="{DynamicResource TagsListStyle}" ItemTemplate="{DynamicResource TagsItemTemplate}" FontSize="11" Margin="0,3,0,0"  />
                            </StackPanel>
                        </StackPanel>
                    </Border>

                    <!-- Photos List Box-->
                    <Border Background="{x:Null}"  Style="{DynamicResource DetailsBorderStyle}"  CornerRadius="0,0,10,10" Grid.Row="1" Margin="10,0,10,10" BorderThickness="1,1,1,1" Padding="5,5,5,5" BorderBrush="{DynamicResource BorderBrush}">
                        <Grid>
                            <TextBlock HorizontalAlignment="Left" Foreground="{DynamicResource FontColor}" FontSize="10"><Run Text=""/></TextBlock>
                            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                                <ListBox AllowDrop="False" ScrollViewer.CanContentScroll="True" x:Name="PhotosListBox" Background="{x:Null}" Style="{DynamicResource PhotosListStyle}" ItemContainerStyle="{DynamicResource PhotosListItemStyle}" SelectionChanged="PhotosListBox_SelectionChanged" Margin="0,0,0,0"></ListBox>
                            </ScrollViewer>
                        </Grid>
                    </Border>

                </Grid>
            </Border>

        </DockPanel>
    </Border>
</UserControl>
